package com.pocket.mic.common.util;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

public class ConfigUtil {
	
	private static Properties global_config = null;
	private static Properties jdbc_config = null;
	
	public static String get(String key) throws FileNotFoundException, IOException {
		
		if(global_config == null){
			global_config = new Properties();
			global_config.load(ConfigUtil.class.getClassLoader().getResource("config/global.properties").openStream());
		}

		return global_config.getProperty(key);
	}

	public static String getJdbc(String key) throws IOException {
		
		if(jdbc_config == null){
			jdbc_config = new Properties();
			jdbc_config.load(ConfigUtil.class.getClassLoader().getResource("config/jdbc.properties").openStream());
		}

		return jdbc_config.getProperty(key);
	}
}
